<template>
<div>
  <myinput @anxia="b" v-model.trim="val"> </myinput>
<mylist :data="list" title="正在进行" @state="changeState" @remove="del"></mylist>
<mylist :data="list" title="已完成" done @state="changeState" @remove="del"></mylist>
  </div>
</template>

<script>
import Input from './components/kuang.vue'
import list from './components/list.vue'
export default {
data(){
return{
  val:'',
  list:[
      {title:'a',done:false},
       {title:'b',done:true},
  ],
}
},
components:{

    myinput:Input,
    mylist:list,
},
methods:{
    b(){
this.list.push({
    title:this.val,
    done:false
})
 this.val=''
    },
    changeState(index,item){
        item.done =!item.done
    },
    del(index,item){
    this.list.splice(index,1)
    },
}
}
</script>

<style>

</style>